import logging

from pylons import request, response, session, tmpl_context as c
from pylons.controllers.util import abort, redirect_to

from blog.lib.base import BaseController, render

log = logging.getLogger(__name__)

class DebugController(BaseController):

    def index(self):
        # Return a rendered template
        #return render('/debug.mako')
        # or, return a response
        return 'Hello World'

    def session(self):
        c._dict=dict(session)
        log.info(session['user'] if 'user' in session else 'USER NOT FOUND')
        return render('/debug/showdict.mako')

    def eviron(self):
        c._dict=request.environ
        return render('/debug/showdict.mako')

    def Raise(self):
        raise StandardError
